package com.tosmart.jorm.annotation;

import java.lang.annotation.*;

/**
 * In addition to supporting the value of the value
 * of the Entity and the associated database tables
 * outside, JORM framework also supports foreign keys
 * associated with mapping.
 * <p/>
 * A typical use case is:
 * <p/>
 * A Log record, there is an associated user ID.
 * In Log Entity class, JORM framework can be based
 * on the user.id (User Entity class primary key) to
 * automatically associate a user object.
 * <p/>
 * The type of Current Entity Field must be another
 * Entity class.
 * <p/>
 * Worthy of note are:
 * JORM framework for automatically mapping is only
 * associated with the object, rather than automatically
 * modify and save the association.
 *
 * @author tosmart@gmail.com
 * @see JormMap
 * @see JormReferList
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface JormRefer {
    /**
     * List of foreign keys in general is another
     * Entity class is a list of the primary key.
     *
     * Follow the Title example, the list of foeign
     * keys is {user.id}
     * 
     * The order of the list of foreign keys and
     * another Entity classes should be the primary
     * key of the list in the order of consistency.
     *
     * @return foreign key list
     */
    String[] foreignKeys() default {};
}
